package com.tanhua.dubbo.server.controller;

import com.tanhua.dubbo.server.service.HuanXinService;
import com.tanhua.dubbo.server.vo.HuanXinUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @ClassName: HuanXinController
 * @Author:王晨晗
 * @Description: 环信请求用户信息
 * @Date: 2022/01/05/18:58
 */
@RestController
@RequestMapping("huanxin")
public class HuanXinController {
    @Autowired
    private HuanXinService huanXinService;

    /**
     * @description 请求当前用户的环信用户信息;当用户登录成功后,客户端会自动调用此接口
     * @return
     */
    @GetMapping("user")
    public ResponseEntity queryHuanXinUser(){
        HuanXinUserVo huanXinUserVo = huanXinService.queryHuanXinUser();
        return ResponseEntity.ok(huanXinUserVo);
    }
}
